local UI = SecretaryUI

local Button_OnClick = function (self)
	self:GetParent().object:OnButtonClick(self.index)
end

local function CreateButton(parent, index)
	local button = CreateFrame("Button", nil, parent)
	button:SetTextFontObject(GameFontNormal)
	button:SetHighlightFontObject(GameFontHighlight)
	button:SetDisabledFontObject(GameFontDisable)
	
	local CreateTexture = UI.CreateTexture
	button:SetNormalTexture(CreateTexture(button, "Interface\\Buttons\\UI-Panel-Button-Up", nil, 0, 0.625, 0, 0.6875))
	button:SetPushedTexture(CreateTexture(button, "Interface\\Buttons\\UI-Panel-Button-Down", nil, 0, 0.625, 0, 0.6875))
	button:SetDisabledTexture(CreateTexture(button, "Interface\\Buttons\\UI-Panel-Button-Disabled", nil, 0, 0.625, 0, 0.6875))
	button:SetHighlightTexture(CreateTexture(button, "Interface\\Buttons\\UI-Panel-Button-Highlight", "ADD", 0, 0.625, 0, 0.6875))
	
	button:SetScript("OnClick", Button_OnClick)
	
	button.index = index
	
	return button
end

UI.CreateButton = CreateButton
